package com.wzy.mall.mapper.clientMapper;

import com.wzy.mall.model.bo.clientBO.OrderAddBO;
import com.wzy.mall.model.bo.clientBO.OrderCartSettleBO;
import com.wzy.mall.model.bo.clientBO.OrderSendCommentBO;
import com.wzy.mall.model.pojo.clientPOJO.CommentPOJO;
import com.wzy.mall.model.pojo.clientPOJO.OrderPOJO;
import com.wzy.mall.model.pojo.clientPOJO.SpecIdAndNumPOJO;
import com.wzy.mall.model.vo.clientVO.OrderCartShowVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrderMapper {

    // 根据用户昵称获取用户id、收件人、地址、电话
    // 根据规格ID获取商品ID、商品名、规格名、单价
    OrderPOJO selectUserAndGoods(OrderAddBO orderAddBO);


    int insertOrder(OrderPOJO orderPOJO);

    List<OrderCartShowVO> getOrderByState(@Param("state") String state, @Param("token") String token);

    int updateOrder(OrderCartSettleBO orderCartSettleBO);

    int updateOrderState(@Param("id") int id, @Param("state") int state);

    int changeVisible(int id);

    CommentPOJO selectCommentInfo(Integer goodsId);

    int insertComment(CommentPOJO commentPOJO);

    void updateOrderCommentState(Integer orderId);

    int selectGoodsStockBySpecID(int goodsDetailId);

    int updateSpecStocknum(@Param("goodsDetailId") Integer goodsDetailId, @Param("stockNum") int stockNum);

    int selectSpecIDByOrderID(Integer orderId);

    SpecIdAndNumPOJO selectSpecIdAndNumByOrderID(int id);
}
